package com.sparrow.source.persistense;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.sparrow.source.common.dto.DeviceVerifyLog;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * @author bryceyung
 * @since 2024/11/19
 */
@TableName("unv_device")
@Data
public class UnvDevice {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private String name;

    private String ip;

    private String deviceModel;

    private String channel;

    private Integer channelFlag;

    private String serialNumber;

    private Boolean onlineStatus;

    private String mac;

    private String firmwareVersion;

    private String hardwareId;

    private String pcbVersion;

    private String ubootVersion;

    private String manufacturingDate;

    private Boolean deleted;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "create_time")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "sync_time")
    private Date syncTime;

    /**
     * 设备打卡记录
     */
    @TableField(exist = false)
    private List<DeviceVerifyLog> reportLog;

    /**
     * 设备上的人员信息
     */
    @TableField(exist = false)
    private List<IasDeviceUser> deviceUserList;

}
